<template>
  <div class="management">
    <!-- <x-header :left-options="{backText: ''}">密码管理</x-header> -->
    <top :text="'密码管理'"></top>
    <div style="height: 40px;"></div>
    <div class="mT10">
      <div class="managementDetail fr" @click="$router.push({path:'/main/modifyLogin'})">
        <div>
          <span class="c3  fa">修改登录密码</span>
        </div>
      </div>
      <div class="managementDetail fr" @click="$router.push({path:'/main/setPayPassword'})" v-if="setPayPassword">
        <div>
          <span class="c3  fa">设置支付密码</span>
        </div>
      </div>
      <div class="managementDetail fr" @click="$router.push({path:'/main/payPassword'})" v-if="!setPayPassword">
        <div>
          <span class="c3  fa">修改支付密码</span>
        </div>
      </div>
      <div class="managementDetail fr" @click="$router.push({path:'/main/forgetPay'})">
        <div>
          <span class="c3  fa">忘记支付密码</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  import { XHeader } from 'vux'
  import http from '../../service/http.js'
  import Top from '../../components/common/top.vue'
  export default {
    data() {
      return {
        setPayPassword: true //默认显示设置支付密码
      }
    },
    mounted() {
      this.hasPay();
    },
    methods: {
      //判断是否有支付密码
      hasPay() {
        http.post('/user/hasPay', {
          username: window.localStorage.getItem("login.username")
        }).then((res) => {
          if (res.data.status == 200 && !res.data.body) {//没有支付密码
            this.setPayPassword = true;
          } else if (res.data.status == 200 && res.data.body) {//有支付密码
            this.setPayPassword = false;
          }
        })
      }
    },
    components: {
      XHeader,
      Top
    }
  }
</script>
<style lang="less" scoped>
  body {
    background: #f6f6f6;
  }

  .management .c9 {
    color: #999;
  }

  .management .fa {
    position: absolute;
  }

  .management .fr {
    position: relative;
  }

  .management .fr15 {
    right: 15px;
  }

  .management .t20 {
    top: 20px;
  }

  .management .t10 {
    top: 10px;
  }

  .management .mT10 {
    margin-top: 10px;
  }

  .management .middle {
    vertical-align: middle;
  }

  .management .mt15 {
    margin-top: 15px;
  }

  .management .mgL8 {
    margin-left: 8px;
  }

  .management .mgb15 {
    margin-bottom: 15px;
  }

  .management .mgT5 {
    margin-top: 5px;
  }

  .management .copyBtn {
    color: #fff;
    background: linear-gradient(left, #fedd32, #fe9f0a);
    display: inline-block;
    width: 50px;
    text-align: center;
    height: 20px;
    line-height: 20px;
    font-size: 13px;
    top: 12px;
  }

  .management .helpLower {
    transition: all 0.5s;
    transform: rotate(180deg);
  }

  .bankMoney {
    border: none;
    outline: none;
    text-align: right;
    display: inline-block;
    height: 45px;
    width: 70%;
    font-size: 15px;
  }

  .management .vux-header {
    background: #fff;
  }

  .management .vux-header .vux-header-title {
    line-height: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: 400;
    color: #000;
  }

  .management .vux-header .vux-header-left .left-arrow:before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1px solid #000;
    border-width: 1px 0 0 1px;
    -webkit-transform: rotate(315deg);
    transform: rotate(315deg);
    top: 8px;
    left: 7px;
  }

  .management .managementDetail {
    border: 1px solid #f6f6f6;
    min-height: 45px;
    line-height: 45px;
    background: #fff;
    padding-left: 15px;
    position: relative;
  }

  .twoToken {
    border-top: 1px solid #f6f6f6;
    margin-top: 10px;
    color: #666;
    font-size: 14px;
    margin-left: -15px;
    padding-left: 15px;
    padding-top: 10px;
  }

  .exitLogin {
    color: #fff;
    height: 45px;
    line-height: 45px;
    text-align: center;
    background: linear-gradient(left, #fedd32, #fe9e09);
    border-radius: 25px;
  }
</style>